﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HuberRace.BusinessLayer;

namespace HuberRace
{
    public partial class AddRace : Form
    {
        Main myParent = null;

        public AddRace(Main myParent)
        {
            InitializeComponent();
            comboBox1.SelectedIndex = 0;
            this.myParent = myParent;
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Race newRace = new Race();
            newRace.Name = raceName.Text;
            Program.CurrentRace = newRace;

            Program.CurrentRace.Times = new List<string>();

            myParent.AddRaceMessage("Race " + newRace.Name + " created");
           
            Close();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void raceName_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void AddRace_Load(object sender, EventArgs e)
        {

        }
    }
}
